Edward Witten knew basic mathematics very well, as you would expect from a physicist working on quantum field theory. He wrote his PhD thesis on topics related to strong interactions under David Gross. I remember reading about Witten in a book about the founders of Index Theory (I forgot what it's called). It has biographical essays on Michael Atiyah, Isadore Singer, Raol Bott and other associated with the inception of Index theory. There was an essay written by Edward Witten on Atiyah. Witten writes that when he was a post-doc at Harvard, Atiyah gave a talk on mathematics related to QFT which none of the physicists (including Witten) understood. But this intrigued Witten and he decided to learn this way of approaching the subject. He talked to Atiyah, who I believe, was the brand ambassador for mathematical physics at that time (You would be surprised to know how many top researchers in this area were influenced by Atiyah). Atiyah invited Witten to spend one year at Oxford and work with him. It was at Oxford, Witten learnt a lot of advance mathematics. Written said in that essay how Atiyah guided him on what to read and he read tons of yellow Springer books on topology and geometry. The interaction with Atiyah lead to some of Witten's greatest work on topology and geometry. And once you acquire a level of mathematical maturity (if you are a mathematician, you know what I'm talking about), you can pretty much dive into any subject and start reading. Witten being a physicist had some level of mathematical maturity which was enhanced multifold after he started working with advance mathematics. I don't think Witten is as strong a mathematician as a professional mathematician. Other than a proof of Positive Energy theorem, I don't think Witten rigorously proved any mathematical statements. He used the advance mathematics in his work, but Witten's genius is in seeing the connections. He showed you can see knot invariants in as physical quantities in QFTs. Witten, with others, came up with some topological/symplectic invariants and these invariants arose as physical quantities in QFTs. They was never rigorously defined and their properties were never proven in Witten's work. Which inspired some mathematicians like Kontsevich to do wonders. He probably knows more maths than a smart beginning grad student in mathematics.